<!DOCTYPE html>
<html>
<head>
<title>请假</title>
#parse("sys/header.html")
</head>
<body>

<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			#if($shiro.hasPermission("leave:save"))
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			#end
			#if($shiro.hasPermission("leave:update"))
			<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			#end
			#if($shiro.hasPermission("leave:delete"))
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			#end
			#if($shiro.hasPermission("leave:list"))
			<a class="btn btn-primary" @click="queryfile"></i>&nbsp;查看附件</a>
			#end
			#if($shiro.hasPermission("leave:submit"))
			<a class="btn btn-primary" @click="submit"><i class="fa fa-pencil-square-o"></i>&nbsp;提交</a>
			#end
			#if($shiro.hasPermission("leave:processInt"))
			<a class="btn btn-primary" @click="processInt"><i class="fa fa-pencil-square-o"></i>&nbsp;审批</a>
			#end
			#if($shiro.hasPermission("leave:popHistory"))
			<a class="btn btn-primary" @click="popHistory"><i class="fa fa-pencil-square-o"></i>&nbsp;审批历史记录</a>
			#end
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList&&!showtable" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
											<div class="form-group">
			   	<div class="col-sm-2 control-label">请假类型</div>
			   	<div class="col-sm-10">
			      <!--<input type="text" class="form-control" v-model="leave.type" placeholder="请假类型"/>-->
					<select v-model="leave.type" class="form-control">
						<option v-for="type in dictList" :value="type.value">{{type.label}}</option>
					</select>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">开始时间</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control"  id="startDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"  readonly="readonly"   v-model="leave.startDate" placeholder="开始时间"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">结束时间</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="leave.endDate" id="endDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"  readonly="readonly"  placeholder="结束时间"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">天数</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="leave.days" placeholder="天数"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">请假理由</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="leave.reason" placeholder="请假理由"/>
			    </div>
			</div>


								<!--	<div class="form-group">
			   	<div class="col-sm-2 control-label">备用1</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="leave.backup1" placeholder="备用1"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">备用2</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="leave.backup2" placeholder="备用2"/>
			    </div>
			</div>-->
							<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>

	<div v-show="showtable" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">

			<div class="form-group" v-show="showtable1" >
				<div class="col-sm-2 control-label">一级主管</div>
				<div class="col-sm-10">
					<input type="text" class="form-control"   readonly="readonly"  @click='popUser("user1")'  v-model="leave.user1" placeholder="一级主管"/>
				</div>
			</div>
			<div class="form-group"  v-show="showtable1">
				<div class="col-sm-2 control-label">二级主管</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" readonly="readonly"  @click='popUser("user2")' v-model="leave.user2" placeholder="二级主管"/>
				</div>
			</div>
			<div class="form-group"  v-show="showtable1">
				<div class="col-sm-2 control-label">三级主管</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" readonly="readonly"  @click='popUser("user3")' v-model="leave.user3" placeholder="三级主管"/>
				</div>
			</div>

			<div v-show="showtable1" class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="submit" value="提交"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>


			<div class="form-group" v-show="showtable2" >
				<div class="col-sm-2 control-label">审批意见</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="leave.remark" placeholder="审批意见"/>
				</div>
			</div>

			<div v-show="showtable2" class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="process" value="批准"/>
				<input type="button" class="btn btn-primary" @click="reject" value="拒绝"/>
				<input type="button" class="btn btn-primary" @click="reload" value="返回"/>
			</div>
		</form>
	</div>

</div>

<!-- 弹出历史记录 -->
<div id="popHistory" style="display: none;padding:10px;">
	<table id="popHistoryGrid"></table>
	<div id="popHistoryGridPager"></div>
</div>

<!-- 弹出历史记录 -->
<div id="popUser" style="display: none;padding:10px;">
	<table id="popUserGrid"></table>
	<div id="popUserGridPager"></div>
</div>

<script src="${rc.contextPath}/js/workflow/leave.js?_${date.systemTime}"></script>
</body>
</html>